package com.edu.dao;

import com.edu.entity.ScoreDetail;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

import java.util.List;
import java.util.Map;

public interface ScoreDetailMapper {
    //1.查询分数清单
    //学生实现
    List<ScoreDetail> queryList(Map<String, String> param);

    //2.保存考试记录
    //表对象: exam_scoredetail
    int savePaperTestRecord(
            @Param("scoreDetails") List<ScoreDetail> scoreDetails
    );

    //3.更新分数数据
    String UPDATE_FIELDS = "stuId=#{stuId},paperId=#{paperId},questionId=#{questionId},questionTitle=#{questionTitle}," +
            "q_typeid=#{q_typeid},questionAnswer=#{questionAnswer},questionScore=#{questionScore}," +
            "correntAnswer=#{correntAnswer},correntScore=#{correntScore},updateDate=now()";
    @Update("update exam_scoredetail set "+ UPDATE_FIELDS +" where id=#{id}")
    int updateScoreDetail(ScoreDetail scoreDetail);
}
